{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#programming_fever\n",
    "import cv2  \n",
    "import numpy as np  \n",
    "\n",
    "img = cv2.imread('E://OpenCV//bentley.png',0)  \n",
    "cv2.imshow('original image',img) \n",
    "\n",
    "ret, thresh1 = cv2.threshold(img, 120, 255, cv2.THRESH_BINARY) \n",
    "ret, thresh2 = cv2.threshold(img, 120, 255, cv2.THRESH_BINARY_INV) \n",
    "ret, thresh3 = cv2.threshold(img, 120, 255, cv2.THRESH_TRUNC) \n",
    "ret, thresh4 = cv2.threshold(img, 120, 255, cv2.THRESH_TOZERO) \n",
    "ret, thresh5 = cv2.threshold(img, 120, 255, cv2.THRESH_TOZERO_INV) \n",
    "  \n",
    "cv2.imshow('Binary Threshold', thresh1) \n",
    "cv2.imshow('Binary Threshold Inverted', thresh2) \n",
    "cv2.imshow('Truncated Threshold', thresh3) \n",
    "cv2.imshow('Set to zero', thresh4) \n",
    "cv2.imshow('Set to zero Inverted', thresh5) \n",
    "    \n",
    "if cv2.waitKey(0) & 0xff == 27:  \n",
    "    cv2.destroyAllWindows()  "
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
